package com.xs.bookspoststation.StudentActivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.xs.bookspoststation.AdminActivity.AdminActivity;
import com.xs.bookspoststation.R;
import com.xs.bookspoststation.UserActivity.AddUserActivity;
import com.xs.bookspoststation.UserActivity.MainActivity;
import com.xs.bookspoststation.UserActivity.OperateUserActivity;
import com.xs.bookspoststation.UserActivity.UserViewActivity;

public class OperateStudentActivity extends AppCompatActivity {
    //定义对象
    private Button addbtn,lookbtn,backbtn,quitbtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_operate_student);
        //绑定控件
        //添加用户按钮
        addbtn = (Button)findViewById(R.id.btn_add_stu1);
        //查看用户按钮
        lookbtn = (Button)findViewById(R.id.btn_sel_stu1);
        //返回按钮
        backbtn = (Button)findViewById(R.id.btn_stu_goback1);
        //退出按钮
        quitbtn = (Button)findViewById(R.id.btn_stu_back1);

        addbtn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View arg0) {
                Intent intent = new Intent(OperateStudentActivity.this, AddStudentActivity.class);
                Toast.makeText(getApplicationContext(), "添加学生界面", Toast.LENGTH_LONG).show();
                startActivity(intent);
            }});
        lookbtn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View arg0) {
                Intent intent=new Intent(OperateStudentActivity.this, StudentViewActivity.class);
                Toast.makeText(getApplicationContext(), "查看学生信息界面", Toast.LENGTH_LONG).show();
                startActivity(intent);
            }});
        backbtn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View arg0) {
                Intent intent = new Intent(OperateStudentActivity.this, AdminActivity.class);
                Toast.makeText(getApplicationContext(), "管理员主界面", Toast.LENGTH_LONG).show();
                startActivity(intent);
            }});
        quitbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(OperateStudentActivity.this, MainActivity.class);
                Toast.makeText(getApplicationContext(), "登录界面", Toast.LENGTH_LONG).show();
                startActivity(intent);
            }
        });
    }
}
